//
//  UUTabBarViewController.m
//  UUCharterSupplier
//
//  Created by ZhangAo on 13/01/2018.
//  Copyright © 2018 UUCharter. All rights reserved.
//

#import "UUTabBarViewController.h"
#import "UUResourceManager.h"

#import "UUHomePageVC.h"
#import "UUOrderVC.h"
#import "UUNotificationVC.h"
#import "UUMyInfoVC.h"

@interface UUTabBarViewController ()

@end

@implementation UUTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIViewController *homePageVC = [[UINavigationController alloc] initWithRootViewController:[UUHomePageVC instanceOfAppropriate]];
    homePageVC.tabBarItem.title = @"首页";
    homePageVC.tabBarItem.image = GetResourceManager().tabBarIconHome;
    homePageVC.tabBarItem.selectedImage = GetResourceManager().tabBarIconHomeHL;
    
    UIViewController *orderVC = [[UINavigationController alloc] initWithRootViewController:[UUOrderVC instanceOfAppropriate]];
    orderVC.title = @"订单 ";
    orderVC.tabBarItem.image = GetResourceManager().tabBarIconOrder;
    orderVC.tabBarItem.selectedImage = GetResourceManager().tabBarIconOrderHL;
    
    UIViewController *notificationVC = [[UINavigationController alloc] initWithRootViewController:[UUNotificationVC instanceOfAppropriate]];
    notificationVC.title = @"消息";
    notificationVC.tabBarItem.image = GetResourceManager().tabBarIconNotification;
    notificationVC.tabBarItem.selectedImage = GetResourceManager().tabBarIconNotificationHL;
    
    UIViewController *myInfoVC = [[UINavigationController alloc] initWithRootViewController:[UUMyInfoVC instanceOfAppropriate]];
    myInfoVC.tabBarItem.title = @"我的";
    myInfoVC.tabBarItem.image = GetResourceManager().tabBarIconMy;
    myInfoVC.tabBarItem.selectedImage = GetResourceManager().tabBarIconMyHL;
    
    NSArray<UIViewController *> *viewControllers = @[
                                                     homePageVC,
                                                     orderVC,
                                                     notificationVC,
                                                     myInfoVC,
                                                     ];
    self.viewControllers = viewControllers;

    self.tabBar.barTintColor = [UIColor whiteColor];
    self.tabBar.tintColor = COMMON_TEXT_DARK_PURPLE_COLOR;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
